package com.aspose.cells;

class zmi extends zbz {
   zmi() {
      this.c(432);
   }

   void a(FormatConditionCollection var1, int var2, int var3) {
      int var4 = var1.getRangeCount();
      int var5 = 14 + var4 * 8;
      if (var5 <= 8224) {
         this.a((short)var5);
         this.c = new byte[this.d()];
         byte var6 = 0;
         System.arraycopy(com.aspose.cells.b.a.zc.a((short)var2), 0, this.c, var6, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a((short)(var3 << 1 | (var1.c ? 1 : 0))), 0, this.c, var6 + 2, 2);
         var6 = 12;
         System.arraycopy(com.aspose.cells.b.a.zc.a(var4), 0, this.c, var6, 2);
         int var14 = var6 + 2;
         int var7 = 65535;
         int var8 = 255;
         int var9 = 0;
         int var10 = 0;
         byte[] var11 = this.c;

         for(int var12 = 0; var12 < var4; ++var12) {
            CellArea var13 = (CellArea)var1.b.get(var12);
            if (var13.StartRow < var7) {
               var7 = var13.StartRow;
            }

            if (var13.StartColumn < var8) {
               var8 = var13.StartColumn;
            }

            if (var13.EndRow > var9) {
               var9 = var13.EndRow;
            }

            if (var13.EndColumn > var10) {
               var10 = var13.EndColumn;
            }

            var14 += a(var11, var14, var13);
         }

         System.arraycopy(com.aspose.cells.b.a.zc.a(var7), 0, this.c, 4, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var9), 0, this.c, 6, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var8), 0, this.c, 8, 2);
         System.arraycopy(com.aspose.cells.b.a.zc.a(var10), 0, this.c, 10, 2);
      } else {
         throw new CellsException(10, "There are too much ranges in one conditional formatting.");
      }
   }

   static int a(byte[] var0, int var1, CellArea var2) {
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.StartRow), 0, var0, var1, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.EndRow), 0, var0, var1 + 2, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.StartColumn), 0, var0, var1 + 4, 2);
      System.arraycopy(com.aspose.cells.b.a.zc.a(var2.EndColumn), 0, var0, var1 + 6, 2);
      return 8;
   }
}
